# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks
pkgname=kiconthemes5
pkgver=5.113.0
pkgrel=0
pkgdesc="Support for icon themes"
# armhf blocked by extra-cmake-module
arch="all !armhf"
url="https://community.kde.org/Frameworks"
license="LGPL-2.1-only"
depends_dev="
	karchive5-dev
	kconfigwidgets5-dev
	kcoreaddons5-dev
	ki18n5-dev
	kitemviews5-dev
	kwidgetsaddons5-dev
	qt5-qtsvg-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	qt5-qttools-dev
	samurai
	"
checkdepends="xvfb-run"
_repo_url="https://invent.kde.org/frameworks/kiconthemes.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/kiconthemes-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
builddir="$srcdir/kiconthemes-$pkgver"

replaces="kiconthemes<=5.110.0-r0"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	# kiconloader_unittest is broken
	xvfb-run ctest --test-dir build --output-on-failure -E "(kiconloader_unittest|kiconloader_resourcethemetest)"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
8945aa9377e2030b2a49d5cbaf573c1f73e497fc266dd9ec21d82cdf4c56a44d74afc977b81f6d4bdaac0e2f1a031ab858ba6a20d0d91fbfdc8d2f7cbacfcb63  kiconthemes-5.113.0.tar.xz
"
